<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="styles.css">
<TITLE>Simkin Examples</TITLE>
</HEAD>
<BODY>

<H1>
Simkin Examples</H1>
<hr>
<p>
There are several examples included with this distribution. They are located in the <b>examples</b> sub-directory where you installed Simkin.
<ul>
<li><a href="examples/helloworld/HelloWorld.java.txt">HelloWorld</a> - a very simple example that prints "Hello World"
<p>
</li>
<li><a href="examples/person/Person.java.txt">Person</a> - this example shows Simkin calling into a Java object
<p>
</li>
<li><a href="examples/array/ArrayExample.java.txt">ArrayExample</a> and <a href="examples/array/Array.xml.txt">Array.xml</a> - this example shows Simkin calling accessing arrays.
<p>
</li>
<li><a href="examples/scriptloader/ScriptLoader.java.txt">Scriptloader</a> - a small Java program that loads an XML file whose name appears on the command line, and runs a method called <b>main</b> within it.<p>You can use this to run the following example scripts:<p>
<ul>
<li><a href="examples/simple/Simple.xml.txt">Simple</a> - shows some simple Simkin script<p>To run this, change to the <b>examples\simple</b> directory and type:
<pre>
java simkin.examples.scriptloader.Scriptloader Simple.xml
</pre>
</li>
<li><a href="examples/fieldaccess/FieldAccess.xml.txt">FieldAccess</a> - shows code accessing elements and sub-elements<p>To run this, change to the <b>examples\fieldaccess</b> directory and type:
<pre>
java simkin.examples.scriptloader.Scriptloader FieldAccess.xml
</pre>
<li><a href="examples/enumerate/Enumerate.xml.txt">Enumerate</a> - shows code enumerating elements within an XML element<p>To run this, change to the <b>examples\enumerate</b> directory and type:
<pre>
java simkin.examples.scriptloader.Scriptloader Enumerate.xml
</pre>
</li>
</ul>
<li><a href="examples/dialog/ScriptedDialog.java.txt">ScriptedDialog</a> - shows how you can use Simkin within an XML file to construct "on-the-fly" dialog boxes.<p>This example uses <a href="examples/dialog/Dialog.xml.txt">Dialog.xml</a> to describe the dialog.
<p>To run the example, change to the <b>examples\dialog</b> directory and type:
<pre>
java simkin.examples.dialog.ScriptedDialog Dialog.xml
</pre>
</li>
<li><a href="examples/inherits/Inherits.java.txt">Inherits</a> - shows how you can extend the Simkin classes to provide an "inheritance" feature in your XML files.<p>Other files in this example are:
<ul>
<li><a href="examples/inherits/InheritsElement.java.txt">InheritsElement.java</a></li>
<li><a href="examples/inherits/InheritsExecutable.java.txt">InheritsExecutable.java</a></li>
<li><a href="examples/inherits/child.xml.txt">child.xml</a></li>
<li><a href="examples/inherits/parent.xml.txt">parent.xml</a></li>
</ul>
<p>To run the example, change to the <b>examples\inherits</b> directory and type:
<pre>
java simkin.examples.inherits.Inherits child.xml
</pre>
</li>
<li><a href="examples/dynamic_treenode/DynamicTreeNode.java.txt">DynamicTreeNode</a> - shows how you can add fields to TreeNodes (and other objects) on-the-fly in your scripts. The object set up in the Java is called by the script <a href="examples/dynamic_treenode/dynamic.dat.txt">dynamic.dat</a>.
<p>To run the example, change to the <b>examples\dynamic_treenode</b> directory and type:
<pre>
java simkin.examples.dynamic_treenode.DynamicTreeNode
</pre>
</li>
<li><a href="examples/servlet/SimkinServlet.java.txt">SimkinServlet</a> - shows how you can execute Simkin script within a servlet. The script is sent to the servlet via form <a href="examples/servlet/index.html">index.html</a>.
<p>You will need to configure your Java application server to run the servlet and set up the URL's in the form appropriately.
</li>
</ul>
</body>
</html>